package com.ruoyi.user.api;

import com.ruoyi.common.core.constant.SecurityConstants;
import com.ruoyi.common.core.constant.ServiceNameConstants;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.user.api.domain.Message;
import com.ruoyi.user.api.factory.RemoteUserMessageFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * 用户商家消息服务
 * 
 * @author ruoyi
 */
@FeignClient(contextId = "remoteUserMessageService", value = ServiceNameConstants.USER_MESSAGE_SERVICE, fallbackFactory = RemoteUserMessageFallbackFactory.class)
public interface RemoteUserMessageService
{
    /**
     * 上传文件
     *
     * @param messages 多条消息
     * @return 结果
     */
    @PostMapping("/message/batch")
    public AjaxResult addBatch(@RequestBody List<Message> messages,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
